package com.chinasofti.bean;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@ToString
@AllArgsConstructor//全参
@NoArgsConstructor//无参
@TableName("user")//指定当前类名对应数据库表名   如果类名和表名一直可以省略注解
public class User {
    @TableField(exist = false)//下列属性数据表不存在
    private String username;
    @TableField(exist = false)
    private String password;

    //以下是数据库字段名
    private Long id;
    private String name;
    private Integer age;
    private String email;

    public User(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    public User(String username, String password) {
        this.username = username;
        this.password = password;
    }
}
